<extend name="default/public/common" />
<block name="meta">
    <!-- 开关 -->
    <link rel="stylesheet" href="__dist__/lib/switch/switch.css">
    <script type="text/javascript" src="__dist__/lib/switch/switch.js"></script>
    <!-- 编辑器 -->
    <link rel="stylesheet" type="text/css" href="__dist__/lib/simditor/styles/simditor.css" />
    <script type="text/javascript" src="__dist__/lib/simditor/scripts/module.js"></script>
    <script type="text/javascript" src="__dist__/lib/simditor/scripts/hotkeys.js"></script>
    <script type="text/javascript" src="__dist__/lib/simditor/scripts/uploader.js"></script>
    <script type="text/javascript" src="__dist__/lib/simditor/scripts/simditor.js"></script>
    <script type="text/javascript" src="__dist__/lib/simditor/scripts/simditor-html.js"></script>
    <!-- 上传 -->
    <link rel="stylesheet" href="__dist__/lib/uploader/zui.uploader.css">
    <script type="text/javascript" src="__dist__/lib/uploader/zui.uploader.js"></script>
    <!-- 日期时间 -->
    <link rel="stylesheet" href="__dist__/lib/datetimepicker/datetimepicker.css">
    <script type="text/javascript" src="__dist__/lib/datetimepicker/datetimepicker.js"></script>
</block>
<block name="main">
    <if condition="$mark eq 'index'">
      <include file="default/slider/index" />
    <elseif condition="$mark eq 'system'" />
      <include file="default/slider/system" />
    <elseif condition="$mark eq 'user'" />
      <include file="default/slider/user" />
    <elseif condition="$mark eq 'content'" />
      <include file="default/slider/content" />
    <elseif condition="$mark eq 'extend'" />
      <include file="default/slider/extend" />
    <elseif condition="$mark eq 'count'" />
        <include file="default/slider/count" />
    <elseif condition="$mark eq 'module'" />
        <include file="default/slider/module" />
    </if>
    <div class="main">
        <div class="crumb">
            <div class="page-actions pull-right">
                <div class="btn-group">
                    <button type="button" class="btn btn-sm btn-back" title="返回"><i class="icon icon-reply"></i></button>
                    <button type="button" class="btn btn-sm btn-refresh" title="刷新"><i class="icon icon-refresh"></i></button>
                    <button type="button" class="btn btn-sm btn-next" title="前进"><i class="icon icon-reply icon-flip-horizontal"></i></button>
                </div>
            </div>
            <ul class="breadcrumb">
                <li><i class="icon icon-home"></i></li>
                <volist name="bread_crumb" id="vo">
                  <li>{$vo}</li>
                </volist>
            </ul>
        </div>
        <div class="container-fluid">
            <div class="panel">
                <div class="panel-heading">
                    <span style="line-height:32px">{$meta_title}</span>
                </div>
                <div class="panel-body">
                  <form action="{$post_url}" method="post" id="data-form">
                      <volist name="form_items" id='item'>
                        <switch name="item.type">
                            <case value="hidden">
                                <include file="default/builder/form/formType/hidden" />
                            </case>
                            <case value="text">
                                <include file="default/builder/form/formType/text" />
                            </case>
                            <case value="password">
                                <include file="default/builder/form/formType/password" />
                            </case>
                            <case value="radio">
                                <include file="default/builder/form/formType/radio" />
                            </case>
                            <case value="switch">
                                <include file="default/builder/form/formType/switch" />
                            </case>
                            <case value="checkbox">
                                <include file="default/builder/form/formType/checkbox" />
                            </case>
                            <case value="select">
                                <include file="default/builder/form/formType/select" />
                            </case>
                            <case value="textarea">
                                <include file="default/builder/form/formType/textarea" />
                            </case>
                            <case value="simditor">
                                <include file="default/builder/form/formType/simditor" />
                            </case>
                            <case value="picture">
                                <include file="default/builder/form/formType/picture" />
                            </case>
                            <case value="image">
                                <include file="default/builder/form/formType/image" />
                            </case>
                            <case value="teamavatar">
                                <include file="default/builder/form/formType/teamavatar" />
                            </case>
                            <case value="upload">
                                <include file="default/builder/form/formType/upload" />
                            </case>
                            <case value="datetime">
                                <include file="default/builder/form/formType/datetime" />
                            </case>
                        </switch>
                      </volist>
                      <if condition="$hiddenSubmit">
                      <else />
                        <button type="submit" class="btn btn-primary"><i class="icon icon-save"></i> 保存</button>
                        <button type="button" class="btn btn-back">取消</button>
                      </if>
                  </form>
                </div>
            </div>
        </div>
    </div>

    <script type="text/javascript">
        $("#data-form").ajaxForm(function(data) {
            if (data.status) {
                layer.alert(data.text, {
                    icon: 1
                }, function() {
                    location.href = data.url;
                });
            } else {
                layer.alert(data.text, {
                    icon: 2
                });
            }
        });
    </script>
</block>
